<!-- 热门标签 -->
<template>
	<view class="hotLabels">
		<view class="LORtop">
			<view class="LORtapl">
				热门标签
			</view>
			<view class="LORtapr">
				更多分类
			</view>
		</view>
		<view class="classiftCen">
			<scroll-view class="scroll-view_H" scroll-x="true">
				<view class="scroll-view-item_H" v-for="( classift ,index) in classiftJson" :key="index">{{ classift.name }}</view>
			</scroll-view>
		</view>
		<view class="hotBook">
			<view v-for="(book , index) in bookList.book" :key="index" class="hotBookf" v-if="index < 8">
				<view class="hotBookfi">
					<img :src="book.imgUrl" alt="">
				</view>
				<view class="hotBookfn">
					{{ book.name }}
				</view>
				<view class="hotBookfclift">
					{{ book.classift }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import books from '@/assets/json/book/books.json'
	export default {
		data() {
			return {
				classiftJson: [
					{
						"id": "01",
						"name": "都市"
					},
					{
						"id": "02",
						"name": "系统"
					},
					{
						"id": "03",
						"name": "重生"
					},
					{
						"id": "04",
						"name": "龙珠"
					},
					{
						"id": "05",
						"name": "无敌"
					},
					{
						"id": "06",
						"name": "带球跑"
					},
					{
						"id": "07",
						"name": "断层"
					},
					{
						"id": "08",
						"name": "屯物质"
					},
					{
						"id": "09",
						"name": "异世穿越"
					},
					{
						"id": "10",
						"name": "空间"
					},
					{
						"id": "11",
						"name": "今古穿"
					},
					{
						"id": "12",
						"name": "神豪"
					},
					{
						"id": "13",
						"name": "异世大陆"
					},
					{
						"id": "14",
						"name": "版主赤狐"
					},
					{
						"id": "15",
						"name": "无限流"
					},
					{
						"id": "16",
						"name": "男扮男装"
					},
					{
						"id": "17",
						"name": "末日求生"
					},
					{
						"id": "18",
						"name": "日久生情"
					},
					{
						"id": "19",
						"name": "乡村"
					},
					{
						"id": "20",
						"name": "大佬"
					},
					{
						"id": "21",
						"name": "国运"
					}
				],
				scroll: 0,
				bookList: books,
				
			}
		},
		onLoad() {
			console.log(books)
		},
		methods: {
			upper: function(e) {
				console.log(e)
			},
			lower: function(e) {
				console.log(e)
			},
		}
	}
</script>

<style lang="less">
	.hotLabels{
		background-color: #ffffff;
		box-sizing: border-box;
		padding: 4vw;
		margin-top: 4vw;
		border-radius: 10px;
	}
	.LORtop{
		display: flex;
		justify-content: space-between;
		align-items: center;
		.LORtapl{
			font-size: 5vw;
			font-weight: bold;
			color: #000000;
		}
		.LORtapr{
			font-size: 4vw;
			color: #000000;
			position: relative;
			margin-right: 2vw;
		}
		.LORtapr::after{
			content: ' ';
			width: 5px;
			height: 5px;
			border-top: 2px #000000 solid;
			border-right: 2px #000000 solid;
			position: absolute;
			right: -2vw;
			top: 2vw;
			transform:rotate(45deg);
			
		}
	}
	.classiftCen{
		margin-top: 4vw;
		.scroll-view_H {
			white-space: nowrap;
			width: 100%;
		}
		.scroll-view-item_H {
			display: inline-block;
			padding: 0.5vw 3vw;
			height: 8vw;
			line-height: 8vw;
			margin-right: 3vw;
			text-align: center;
			font-size: 3.8vw;
			border-radius: 4vw;
			background-color: #f0f0f0;
		}
		.scroll-view_H::-webkit-scrollbar {
		  width: 0px;
		  height: 0px;
		  background-color: rgba(0, 0, 0, 0);
		}
		
		.scroll-view_H::-webkit-scrollbar-track {
		  -webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0);
		  border-radius: 10px;
		  background-color: rgba(0, 0, 0, 0);
		}
		
		.scroll-view_H::-webkit-scrollbar-thumb {
		  border-radius: 10px;
		  -webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0);
		  background-color: rgba(0, 0, 0, 0);
		}
	}
	.hotBook{
		display: flex;
		width: 84vw;
		justify-content: space-between;
		flex-wrap: wrap;
		margin-top: 2vw;
		.hotBookf{
			width: 18vw;
			margin-top: 3vw;
			.hotBookfi{
				width: 18vw;
				height: 25.2vw;
				img {
					width: 18vw;
					height: 25.2vw;
				}
			}
			.hotBookfn{
				margin-top: 2vw;
				font-size: 3.5vw;
				height: 9vw;
				color: #000000;
				overflow: hidden;
				text-overflow: ellipsis; 
				display:-webkit-box; 
				-webkit-box-orient:vertical; 
				-webkit-line-clamp: 2;  
			}
			.hotBookfclift{
				margin-top: 2vw;
				font-size: 3vw;
				color: #ccc;
				overflow: hidden;
				text-overflow:ellipsis;
				white-space: nowrap;
			}
		}
	}
	
	
</style>
